@page   
@using YoYoMooc.StudentManagement.RazorPage.Pages.ViewComponents
@model YoYoMooc.StudentManagement.RazorPage.Pages.Students.IndexModel
@{
    ViewData["Title"] = "学生列表";
        //使用ViewData传递true来告诉分部视图显示查看编辑和删除按钮
    ViewData["ShowButtons"] = true;
}

<style>
    .btn {
        width: 75px;
    }
</style>





@await  Component.InvokeAsync("HeadCount")

@*
@await  Component.InvokeAsync("HeadCount",new { Major=MajorEnum.ComputerScience })
@await  Component.InvokeAsync(typeof(HeadCountViewComponent),new { Major=MajorEnum.Mathematics })
*@

<h1>学生列表</h1>

<form method="get">
    <div class="input-group">
        <input class="form-control" placeholder="请输入搜索关键字" asp-for="SearchTerm">
        <div class="input-group-append">
            <button class="btn btn-primary" type="submit">搜索</button>
        </div>
    </div>
</form>

<div class="card-deck">
    @foreach (var student in Model.Students)
    {
        <partial name="_DisplayStudentPartial" model="student" view-data="ViewData" />

    }
</div>